package com.fruit.service.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fruit.service.weather.impl.WeatherService;
import com.fruit.util.DateUtil;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service("weatherTaskJob")
public class WeatherTaskJob {
	protected Logger logger = LoggerFactory.getLogger(WeatherTaskJob.class);
	@Autowired
	private WeatherService weather;
	
	public void doJob(){
		log.info("【基地天气任务调度】----【开始】---【"+DateUtil.getTime()+"】------------");
		try {
			weather.updateAllBaseWeather();
		} catch (Exception e) {
			log.info("【基地天气任务调度】----【异常】---【"+DateUtil.getTime()+"】------------");
		}finally {
			log.info("【基地天气任务调度】----【结束】---【"+DateUtil.getTime()+"】------------");
		}
		
	}
	
}
